//
//  NWalletHeaderView.m
//  News
//
//  Created by zhangtao on 2018/10/8.
//  Copyright © 2018年 zt.td. All rights reserved.
//

#import "NWalletHeaderView.h"

@implementation NWalletHeaderView

// 0
- (IBAction)help:(id)sender {
    [self callBack:((UIButton *)sender).tag];
}

//股币明细 1
- (IBAction)guBiDetail:(id)sender {
    [self callBack:((UIButton *)sender).tag];
}

//现金明细 2
- (IBAction)cashDetail:(id)sender {
    [self callBack:((UIButton *)sender).tag];
}

//折为现金 3
- (IBAction)becomeCash:(id)sender {
    [self callBack:((UIButton *)sender).tag];
}

//提现 4
- (IBAction)cash:(id)sender {
    [self callBack:((UIButton *)sender).tag];
}

//股币富豪榜 5
- (IBAction)guBiSort:(id)sender {
    [self callBack:((UIButton *)sender).tag];
}

// 6攻略
- (IBAction)gongLve:(id)sender {
    [self callBack:((UIButton *)sender).tag];
}

-(void)callBack:(WALLET_HEAD_CLICK_TAG)tag{
    if (self.WalletHeadCallBack) {
        self.WalletHeadCallBack(tag);
    }
}
//
-(void)awakeFromNib{
    [super awakeFromNib];
//   UIView *view = [[NSBundle mainBundle]loadNibNamed:@"NWalletHeaderView" owner:self options:nil].firstObject;
//    [self addSubview:view];
    
//    [_helpBtn setAttributedTitle:[self addUnderLineAttributeStr:@"帮助中心"] forState:UIControlStateNormal];
//    
//    [_guBiDetailBtn setAttributedTitle:[self addUnderLineAttributeStr:@"明细"] forState:UIControlStateNormal];
//    
//    [_cashDetailBtn setAttributedTitle:[self addUnderLineAttributeStr:@"明细"] forState:UIControlStateNormal];
    

    
}

-(NSMutableAttributedString *)addUnderLineAttributeStr:(NSString *)str{
    NSMutableAttributedString * attStr = [[NSMutableAttributedString alloc]initWithString:str];
    [attStr addAttribute:NSUnderlineStyleAttributeName value:[NSNumber numberWithInteger:NSUnderlineStyleSingle] range:NSMakeRange(0, str.length)];
    return attStr;
}

- (void)bindData:(SubscriberWalletSummaryModel *)model
{
    self.gupiaoNumLab.text = [NSString stringWithFormat:@"%@",@(model.coinAccount)];
    self.zuoriGupiaoNumLab.text = [NSString stringWithFormat:@"%@",@(model.yeasterdayCoinAdded)];
    self.zuiriMoneyLab.text = [NSString stringWithFormat:@"%@",@(model.yesterdayAmountAdded)];
}

- (void)bindData1:(TotalCoinOfRewardedModel *)model
{
    self.moneyLab.text = [NSString stringWithFormat:@"%@",@(model.coinAccount)];
    self.shequLeiJiLab.text = [NSString stringWithFormat:@"%@",@(model.totalCoinUpLimit)];
    self.shequZuoriLab.text = [NSString stringWithFormat:@"%@",@(model.yesterdayReward)];
    self.guzhiLab.text = [NSString stringWithFormat:@"%@",@(model.price)];
}

@end
